// pages/index/orderNum/orderNum.js
/**
 * 待完善功能：
 * 1、触底加载
 * 2、上拉刷新
 * 3、搜索
 */
Page({

  /**
   * 页面的初始数据
   */
  data: {
    hospitals: [{
      name: '北京协和医院',
      address: '北京市东城区帅府园1号',
      intorduce: '简介简介简介简介简介简介简介简介简介简介',
      people: 120,
      grade: '三甲',
      distance: 3.6,
      img: 'https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1597126149074&di=a507af93d828f0006941bde77c655362&imgtype=0&src=http%3A%2F%2F5b0988e595225.cdn.sohucs.com%2Fimages%2F20181011%2Fc533cec5d5274a4a9e3a59eeb8fe7630.jpeg',
    }
    ,{
      name: '北京协和医院',
      address: '北京市东城区帅府园1号',
      intorduce: '简介简介简介简介简介简介简介简介简介简介',
      people: 120,
      grade: '三甲',
      distance: 3.6,
      img: 'https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1597126149074&di=a507af93d828f0006941bde77c655362&imgtype=0&src=http%3A%2F%2F5b0988e595225.cdn.sohucs.com%2Fimages%2F20181011%2Fc533cec5d5274a4a9e3a59eeb8fe7630.jpeg',
    },{
      name: '北京协和医院',
      address: '北京市东城区帅府园1号',
      intorduce: '简介简介简介简介简介简介简介简介简介简介',
      people: 120,
      grade: '三甲',
      distance: 3.6,
      img: 'https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1597126149074&di=a507af93d828f0006941bde77c655362&imgtype=0&src=http%3A%2F%2F5b0988e595225.cdn.sohucs.com%2Fimages%2F20181011%2Fc533cec5d5274a4a9e3a59eeb8fe7630.jpeg',
    },{
      name: '北京协和医院',
      address: '北京市东城区帅府园1号',
      intorduce: '简介简介简介简介简介简介简介简介简介简介',
      people: 120,
      grade: '三甲',
      distance: 3.6,
      img: 'https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1597126149074&di=a507af93d828f0006941bde77c655362&imgtype=0&src=http%3A%2F%2F5b0988e595225.cdn.sohucs.com%2Fimages%2F20181011%2Fc533cec5d5274a4a9e3a59eeb8fe7630.jpeg',
    },{
      name: '北京协和医院',
      address: '北京市东城区帅府园1号',
      intorduce: '简介简介简介简介简介简介简介简介简介简介',
      people: 120,
      grade: '三甲',
      distance: 3.6,
      img: 'https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1597126149074&di=a507af93d828f0006941bde77c655362&imgtype=0&src=http%3A%2F%2F5b0988e595225.cdn.sohucs.com%2Fimages%2F20181011%2Fc533cec5d5274a4a9e3a59eeb8fe7630.jpeg',
    },
  ],
  },

  goDepartment(e) {
    // console.log(e.currentTarget.dataset.item)
    let emitData = e.currentTarget.dataset.item
    wx.navigateTo({
      url: 'department/department',
      events: {
        hospitalsDate(data) {console.log(data)}
      },
      success: (res) => {
        // 通过eventChannel向被打开页面传送数据
        res.eventChannel.emit('hospitalsDate', { data: emitData })
      },
      fail: (err) => {console.log('err', err)},
      complete: () => {}
    });
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {

  },

  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady: function () {

  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function () {

  },

  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide: function () {

  },

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload: function () {

  },

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh: function () {

  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom: function () {

  },

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage: function () {

  }
})